# 导入所需的库
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# 读取 CSV 文件
df = pd.read_csv('C:/Users/Administrator/Desktop/car_prices.csv')

# 查看数据集中所有列名
print('数据集中所有列名：', df.columns)

# 读取数据集
df = pd.read_csv('C:/Users/Administrator/Desktop/car_prices.csv')

# 统计不同汽车类型的销售数量
body_counts = df['body'].value_counts()

# 计算占比
body_percentages = body_counts / body_counts.sum() * 100

# 绘制饼状图
plt.figure(figsize=(8, 8))
plt.pie(body_percentages, labels=body_percentages.index, autopct='%1.2f%%')
plt.title('The influence of used car body on sales volume')
plt.show()